﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.StaticFiles;

namespace CommonUtils
{
    /// <summary>
    /// app.UseStaticFiles(StaticFileFilter.Options);
    /// </summary>
    public class StaticFileFilter
    {
        private static void OnPrepareResponse(StaticFileResponseContext context)
        {
            LogUtil.PrintInfo("Static file request:{0}", Options.RequestPath);
        }

        public static StaticFileOptions Options;

        static StaticFileFilter()
        {
            Options = new StaticFileOptions();
            Options.OnPrepareResponse = OnPrepareResponse;
        }
    }
}